package com.yeziji.dataCenter.controller.v1;

import com.yeziji.common.CommonResult;
import com.yeziji.common.base.UserOnlineBase;
import com.yeziji.dataCenter.common.auth.OpenAuth;
import com.yeziji.dataCenter.config.security.auth.OpenSecurityUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 鉴权接口
 *
 * @author hwy
 * @since 2024/11/07 10:18
 **/
@RestController
@RequestMapping("/api/v1/auth")
public class AuthController {
    @Resource
    private OpenSecurityUserService openSecurityUserService;

    @GetMapping("/token")
    public CommonResult<String> token(@RequestBody OpenAuth auth) {
        UserOnlineBase login = openSecurityUserService.login(auth);
        return CommonResult.success("ok");
    }
}
